2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "jucer_Headers.h"
27 #include "ui/jucer_MainWindow.h"
29 ApplicationCommandManager
* commandManager
= 0;
32 //==============================================================================
33 class JucerApplication
: public JUCEApplication
35 MainWindow
* theMainWindow
;
38 //==============================================================================
48 //==============================================================================
49 void initialise (const String
& commandLine
)
51 commandManager
= new ApplicationCommandManager();
53 theMainWindow
= new MainWindow();
54 theMainWindow
->setVisible (true);
56 ImageCache::setCacheTimeout (30 * 1000);
58 if (commandLine
.trim().isNotEmpty()
59 && ! commandLine
.trim().startsWithChar ('-'))
60 anotherInstanceStarted (commandLine
);
68 deleteAndZero (commandManager
);
71 //==============================================================================
72 void systemRequestedQuit()
74 if (theMainWindow
== 0 || theMainWindow
->closeAllDocuments())
76 deleteAndZero (theMainWindow
);
78 StoredSettings::deleteInstance();
84 //==============================================================================
85 const String
getApplicationName()
90 const String
getApplicationVersion()
92 return String (JUCER_MAJOR_VERSION
) + "." + String (JUCER_MINOR_VERSION
);
95 bool moreThanOneInstanceAllowed()
100 return true; //xxx should be false but doesn't work on linux..
104 void anotherInstanceStarted (const String
& commandLine
)
106 if (theMainWindow
!= 0 && commandLine
.unquoted().isNotEmpty())
107 theMainWindow
->openFile (commandLine
.unquoted());
112 START_JUCE_APPLICATION(JucerApplication
)